package com.baitai.system.service.impl;

import java.util.List;
import com.baitai.common.utils.DateUtils;
import com.baitai.system.domain.vo.SysUserPrizesVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baitai.system.mapper.SysUserPrizesMapper;
import com.baitai.system.domain.SysUserPrizes;
import com.baitai.system.service.ISysUserPrizesService;

/**
 * 用户奖品Service业务层处理
 * 
 * @author xx
 * @date 2024-07-21
 */
@Service
public class SysUserPrizesServiceImpl implements ISysUserPrizesService 
{
    @Autowired
    private SysUserPrizesMapper sysUserPrizesMapper;

    /**
     * 查询用户奖品
     * 
     * @param id 用户奖品主键
     * @return 用户奖品
     */
    @Override
    public SysUserPrizes selectSysUserPrizesById(Long id)
    {
        return sysUserPrizesMapper.selectSysUserPrizesById(id);
    }

    /**
     * 查询用户奖品列表
     * 
     * @param sysUserPrizes 用户奖品
     * @return 用户奖品
     */
    @Override
    public List<SysUserPrizes> selectSysUserPrizesList(SysUserPrizes sysUserPrizes)
    {
        return sysUserPrizesMapper.selectSysUserPrizesList(sysUserPrizes);
    }

    /**
     * 新增用户奖品
     * 
     * @param sysUserPrizes 用户奖品
     * @return 结果
     */
    @Override
    public int insertSysUserPrizes(SysUserPrizes sysUserPrizes)
    {
        sysUserPrizes.setCreateTime(DateUtils.getNowDate());
        return sysUserPrizesMapper.insertSysUserPrizes(sysUserPrizes);
    }

    /**
     * 修改用户奖品
     * 
     * @param sysUserPrizes 用户奖品
     * @return 结果
     */
    @Override
    public int updateSysUserPrizes(SysUserPrizes sysUserPrizes)
    {
        sysUserPrizes.setUpdateTime(DateUtils.getNowDate());
        return sysUserPrizesMapper.updateSysUserPrizes(sysUserPrizes);
    }

    /**
     * 批量删除用户奖品
     * 
     * @param ids 需要删除的用户奖品主键
     * @return 结果
     */
    @Override
    public int deleteSysUserPrizesByIds(Long[] ids)
    {
        return sysUserPrizesMapper.deleteSysUserPrizesByIds(ids);
    }

    /**
     * 删除用户奖品信息
     * 
     * @param id 用户奖品主键
     * @return 结果
     */
    @Override
    public int deleteSysUserPrizesById(Long id)
    {
        return sysUserPrizesMapper.deleteSysUserPrizesById(id);
    }

    @Override
    public List<SysUserPrizesVo> selectSysUserPrizesVoList(SysUserPrizes sysUserPrizes) {
        return sysUserPrizesMapper.selectSysUserPrizesVoList(sysUserPrizes);
    }
}
